package com.ieds.core.model;


import java.util.Date;
import java.util.Objects;

/**
 * @Auther: wanglei
 * @Date: 2020.05.25
 * @Description: com.ieds.core.model
 * @version: 1.0
 */
public class KDatabaseMonitor {
    private Long id;
    //数据源ID
    private Integer databaseId;
    //数据源名称
    private String databaseName;
    //数据源类型：1-输入源；2-输出源
    private Integer databaseType;
    //作业或转换ID
    private Integer jobortransId;
    //资源类型：1-作业；2-转换
    private Integer sourceType;
    //成功次数
    private Integer successCount;
    //失败次数
    private Integer failCount;
    //执行时间
    private Date executeTime;

    public KDatabaseMonitor() {
    }

    public KDatabaseMonitor(Long id, Integer databaseId, String databaseName, Integer databaseType, Integer jobortransId, Integer sourceType, Integer successCount, Integer failCount, Date executeTime) {
        this.id = id;
        this.databaseId = databaseId;
        this.databaseName = databaseName;
        this.databaseType = databaseType;
        this.jobortransId = jobortransId;
        this.sourceType = sourceType;
        this.successCount = successCount;
        this.failCount = failCount;
        this.executeTime = executeTime;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Integer getDatabaseId() {
        return databaseId;
    }

    public void setDatabaseId(Integer databaseId) {
        this.databaseId = databaseId;
    }

    public String getDatabaseName() {
        return databaseName;
    }

    public void setDatabaseName(String databaseName) {
        this.databaseName = databaseName;
    }

    public Integer getDatabaseType() {
        return databaseType;
    }

    public void setDatabaseType(Integer databaseType) {
        this.databaseType = databaseType;
    }

    public Integer getJobortransId() {
        return jobortransId;
    }

    public void setJobortransId(Integer jobortransId) {
        this.jobortransId = jobortransId;
    }

    public Integer getSourceType() {
        return sourceType;
    }

    public void setSourceType(Integer sourceType) {
        this.sourceType = sourceType;
    }

    public Integer getSuccessCount() {
        return successCount;
    }

    public void setSuccessCount(Integer successCount) {
        this.successCount = successCount;
    }

    public Integer getFailCount() {
        return failCount;
    }

    public void setFailCount(Integer failCount) {
        this.failCount = failCount;
    }

    public Date getExecuteTime() {
        return executeTime;
    }

    public void setExecuteTime(Date executeTime) {
        this.executeTime = executeTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        KDatabaseMonitor that = (KDatabaseMonitor) o;
        return Objects.equals(databaseId, that.databaseId) &&
                Objects.equals(databaseName, that.databaseName) &&
                Objects.equals(databaseType, that.databaseType);
    }

    @Override
    public int hashCode() {
        return Objects.hash(databaseId, databaseName, databaseType);
    }

    @Override
    public String toString() {
        return "KDatabaseMonitor{" +
                "id=" + id +
                ", databaseId=" + databaseId +
                ", databaseName='" + databaseName + '\'' +
                ", databaseType='" + databaseType + '\'' +
                ", jobortransId=" + jobortransId +
                ", sourceType=" + sourceType +
                ", successCount=" + successCount +
                ", failCount=" + failCount +
                ", executeTime=" + executeTime +
                '}';
    }
}
